home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / acpi / thinkpad-lockorbattery.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2006-10-15  |  961 b   |  41 lines

  1. #!/bin/sh
  2.  
  3. # Lenovo are great.  They have changed the function of the Fn-F3
  4. # combination on the LenovoPads from KEY_LOCK => KEY_BATTERY.
  5. # Unfortunately they didn't bother to change the DMI strings
  6. # consistently...  so some of the new machines say 'LENOVO' and some
  7. # still say 'IBM'.  Yay for consistency(!).
  8. #
  9. # (And just to top that, LENOVO have started producing non-ThinkPad
  10. # laptop computers).
  11.  
  12. # So:
  13. # IBM && !Series60   => Lock
  14. # IBM && Series60    => Battery
  15. # LENOVO && ThinkPad => Battery
  16.  
  17. . /usr/share/acpi-support/key-constants
  18.  
  19. system_version=`dmidecode -s system-version`
  20. system_manufactuer=`dmidecode -s system-manufacturer`
  21.  
  22. case "$system_manufactuer" in
  23.     IBM*)
  24.     case "$system_version" in
  25.     ThinkPad\ [TXZ]60*)
  26.     acpi_fakekey $KEY_BATTERY
  27.     ;;
  28.     *)
  29.     if [ -x /etc/acpi/screenblank.sh ] ; then
  30.         . /etc/acpi/screenblank.sh
  31.     else
  32.         acpi_fakekey $KEY_COFFEE
  33.     fi
  34.     ;;
  35.     esac
  36.     ;;
  37.     LENOVO*)
  38.     acpi_fakekey $KEY_BATTERY
  39.     ;;
  40. esac
  41.